

        
        function defer (interval, scope) 
        {
            var method= this
            ,   presetArgs= [].slice.call(arguments, 2)
            ,   timeoutId
            ,   controller
             
            controller=    
            {
                hasExecuted: false
            ,   scope: scope
            ,   arguments: presetArgs
            ,   dispose: function () 
                {
                    clearTimeout(timeoutId);
                    this.execute= new Function;
                }
            ,   result: null
            ,   fault: null
            ,   onExecute: function () {}
            ,   execute: function () 
                {
                    var status= true; 
                    try 
                    {
                        controller.result= method.apply(scope, controller.arguments);
                    }
                    catch (thrown) 
                    {
                        controller.fault= thrown;
                        status= false;
                    }
                    
                    controller.hasExecuted= true;
                    controller.onExecute(status);
                    controller.dispose(); 
                }
            }
            
            controller.timeoutId= setTimeout(controller.execute, interval);
            return controller;
        }

        